﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ttlang.semantic
{
    //语义容器只有NameSpace和 类型中的class 和 struct， enum 和 delegate 并非语义容器，但他们也是type
    public enum ContainerType
    {
        NameSpace,
        Type,
    }
    public interface IContainer
    {
        ContainerType type
        {
            get;
        }
        string name
        {
            get;
        }
        string fullname
        {
            get;
        }
        Module module
        {
            get;
        }
        IContainer parentContainer
        {
            get;
        }
        IList<string> comments
        {
            get;
        }
        void AddComment(string comment);
        IReadOnlyDictionary<string, TTNameSpace> namespaces
        {
            get;
        }
        IReadOnlyDictionary<string, TTType> types
        {
            get;
        }
        IReadOnlyDictionary<string, TTMethod> methods
        {
            get;
        }
        IReadOnlyDictionary<string, TTVar> vars
        {
            get;
        }
        void AddNameSpace(TTNameSpace _namespace);
        void AddType(TTType container);
        void AddMethod(TTMethod method);
        void AddVar(TTVar var);

        bool FindMember(string id, out IMember member);

        bool FindSubContainer(string id, out IContainer container);


    }
}
